As a conventional method of coding or decoding an image signal, there has been provided MPEG-4 (Moving Picture Experts Group Phase-4) visual (ISO/IEC 14496-2). MPEG-4 is a method of regarding a moving image sequence as a collection of moving image objects each of which has an arbitrary shape in space and in time, and performing coding and decoding the moving image sequence in units of each moving image object.
In MPEG-4, each moving image object including a time axis is referred to as a Video Object, each element of a Video Object is referred to as a Video Object Layer (VOL), each element of a VOL is referred to as a Group of Video Object Plane (GOV), and image data which shows the state of a GOV at each time and which is used as a unit to be coded is referred to as a Video Object Plane (VOP). In a case of handling an object of rectangular shape, a VOP corresponds to a frame. Each VOP is coded in units of each macro block which is a unit region to be coded. Each macro block is a rectangular block of 16 pixels×16 lines. Each macro block is further divided into blocks of 8 pixels×8 lines, and a motion compensation prediction is performed in units of each macro block or each block of 8 pixels×8 lines.
Selection of the size of each block for the motion compensation prediction can be changed for each of the macro blocks. Whether to code a target macro block can be determined for each of the macro blocks. When not coding the target macro block (in a non-coding mode), decoded data about a macro block at the same position (right in back) of an immediately-previous frame are used. When the target macro block is coded, whether to perform a motion compensation prediction (an inter coding mode) or to perform the coding using only information about the target frame without performing any inter frame prediction using a motion compensation prediction (an intra coding mode) can be selected in units of each macro block.
Furthermore, there has been provided an image coding/decoding method of being able to divide an image into macro blocks having a plurality of sizes in division of the image into blocks when performing a coding process, thereby making a macro block corresponding to a part of the image with higher importance in its image quality have a smaller size and also making a macro block corresponding to a part of the image with lower importance in its image quality have a larger size (for example, refer to patent reference 1).    [Patent reference 1] JP,11-146367,A
A problem with such the conventional image coding/decoding method is that because the macro block size is fixed, the macro block size cannot be changed adaptively according to the resolution of the image or the descriptions of the image (the fineness of a pattern of the image, the intensity of a motion in the image, etc.). Particularly, when the resolution of the image becomes high, the use of the fixed macro block size adopted by the conventional image coding/decoding method causes a case in which a region covered by macro blocks is localized, and neighboring macro blocks have the same coding mode or the same motion vector. In such a case, because the overhead due to coding mode information and motion vector information which are coded in units of each macro block increases though the prediction efficiency does not increase, the whole coding efficiency decreases.
When the image has few motions or any motion in frames of the image is constant even if the image has a low resolution, the conventional image coding/decoding method causes a case in which neighboring macro blocks have the same coding mode (non-coding mode) or the same motion vector. Generally, when the size of each macro block is large, the amount of information about the overhead required in units of each macro block, such as the coding mode, can be reduced. However, because switching of the coding mode in units of a unit region having a smaller size than the macro block size cannot be performed, the prediction efficiency in the vicinity of a boundary of a region having large intensity of motion or a region including different motions (a person and a background, or the like) decreases, and therefore the coding efficiency decreases. In contrast, when the size of each macro block is small, although the number of macro blocks increases and the amount of information about the overhead, such as the coding mode, increases, because switching of the coding mode can be performed adaptively in the vicinity of a boundary of a region having large intensity of motion or a region including different motions (a person and a background, or the like), the predictive efficiency is improved and therefore the coding efficiency is improved.
Furthermore, a problem with the technology disclosed by above-mentioned conventional patent reference 1 is that because the size is changed adaptively within each frame, the amount of codes of the rectangular size information is large.
The present invention is made in order to solve the above-mentioned problems, and it is therefore an object of the present invention to provide a moving image coding apparatus which can code an image while changing the size of each of rectangular regions adaptively according to the resolution or the descriptions of the image, and which can suppress the increase in the rectangle size information of the coded image due to the changing, and a moving image decoding apparatus.